﻿//Author:Michal Sporna
//License: https://operationsneakpeek.codeplex.com/license

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Util.Helpers
{
    public static class PublicEnums
    {
        #region Characters
        public enum NPCType { None, hostile, story, neutral };
        public enum NPCKind { None, human, animal };
        public enum AvatarPosition { None, Stand, Crouch, Lay,Dive };
        

        #region NPC
        public enum NPCState { None, Walking, Attacking, LookingFor };
        public enum FieldOfViewDirection { None,Right,Left, Up, Down, CrossUpLeft,CrossUpRight,CrossDownRight, CrossDownLeft };
        public enum NPCMoveDirection { None, right, left, up, down, crossDownLeft, crossDownRight, CrossUpRight, crossUpLeft };
        public enum NPCTextureType { Walk, Attack, Attack1 }
        #endregion
        #endregion

        #region Events
        public enum EventType { None, onAvatarSpotted, onBombDefused, onDefuseStart, onDefuseFailed, OnInteraction, onLandmineStepped,onItemCollected,onItemUsed};
        #endregion

        #region Dialog
        public enum DialogType { None, Protagonyst, Antagonyst };

        #endregion

        #region Obstacle
        //type of obstacle
        public enum ObstacleType { None, StaticNoHarm, StaticHarm, MovingHarm,StaticNoHarmInteractive };
        public enum ShieldType { None, Up, Down, UpDown };
        #endregion

        #region items
        public enum ItemType { None,Apply, Achievement, Required };
        public enum ItemAction { None, Active, Passive, Interaction };
        public enum ItemMoveDirection { None, Right, Left, Up, Down };
        #endregion

        #region requirements
        public enum EntityType { None,Bomb, Item, NPC };
        //Defuse-must defuse 1 bomb
        //defuseDoube-must join 2 bombs and defuse
        //defuseTriple-must joint 3 bombs and defuse
        //defuseFour-must join 4 bmobs and defuse
        //collect-must collect some item
        //knockout-must knockout npc
        //knockoutLow-must knockout npc with low aggresion
        //knockoutMedium-must knocout npc with medium aggresion
        //time-must complete game before x time is elapsed
        public enum RequirementAction { None,Defuse, DefuseDouble, DefuseTriple, DefuseFour, Collect, Knockout,KnockoutLow, KnockoutMedium, Time };
        #endregion


        #region bomb
        public enum ExplosionType { None,small, medium, large };
        public enum WireShuffleType {none,oneOne,twoTwo,threeThree,oneTwo,TwoThree,FourFive,FiveSix,sixSeven,sevenEight};
        
        #endregion

        #region world
        public enum AcheivementType { None, AvatarHidden,BombDefused,BombFound,LetterFound,AllLettersFound };
        public enum ActionButtonClicked { None, Inventory, Sneak, Walk, Run, LayDown, Stand, Crouch, PowerUp };
        public enum CollisionDirection { None, Right,Left,Down,Up };
        #endregion

        #region movement
        public enum Direction { None, Up, Down, Left, Right, DiagonalRightUp, DiagonalRightDown, DiagonalLeftUp, DiagonalLeftDown };
        public enum NodeType { None,Node, Portal,Obstacle, Item,Avatar, Water,NPC,Bomb,Letter };
        #endregion

        #region markers
        public enum MarkerType { None, Green, Red, Orange };



        #endregion

        #region scanner node warmth
        public enum NodeWarmth { None, VeryCold, Cold, Warm, Hot, VeryHot };
        #endregion

        #region METHODS

        /// <summary>
        /// Convert Direction
        /// to haracters.Helpers.MovePatternCheckpoint.Direction
        /// </summary>
        /// <param name="dir"></param>
        /// <returns></returns>
        public static Characters.Helpers.MovePatternCheckpoint.Direction ConvertDirectionToMovePatternDirection(Direction dir)
        {
            try
            {
                switch (dir)
                {
                    case Direction.None:
                        {
                            return Characters.Helpers.MovePatternCheckpoint.Direction.None;
                        }
                    case Direction.Left:
                        {
                            return Characters.Helpers.MovePatternCheckpoint.Direction.Left;

                        }
                    case Direction.Right:
                        {
                            return Characters.Helpers.MovePatternCheckpoint.Direction.Right;
                        }
                    case Direction.Up:
                        {

                            return Characters.Helpers.MovePatternCheckpoint.Direction.Up;
                        }
                    case Direction.Down:
                        {

                            return Characters.Helpers.MovePatternCheckpoint.Direction.Down;
                        }
                }

                return Characters.Helpers.MovePatternCheckpoint.Direction.None;

            }
            catch (Exception ex)
            {
                Util.ErrorLogging.LogError(ex);
                return Characters.Helpers.MovePatternCheckpoint.Direction.None;
            }

        }

        /// <summary>
        /// Get opposite direction of
        /// specified direction
        /// </summary>
        /// <param name="dir"></param>
        /// <returns></returns>
         public static Util.Helpers.PublicEnums.Direction ComputeOppositeDirection(Direction dir)
         {
             try
             {
                 switch (dir)
                 {
                     case Direction.Up:
                         {
                             return Direction.Down;

                         }
                     case Direction.Down:
                         {
                             return Direction.Up;
                         }
                     case Direction.Right:
                         {
                             return Direction.Left;
                         }
                     case Direction.Left:
                         {
                             return Direction.Right;
                         }
                 }

                 return Direction.None;


             }
             catch (Exception ex)
             {
                 Util.ErrorLogging.LogError(ex);
                 return Util.Helpers.PublicEnums.Direction.None;
             }
         }

        #endregion

    }
}
